<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<!--<link href="/css/web/themes/about.css" rel="stylesheet">-->
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">

<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li ><a href="/certificate/dataDownload/skillLeve">职业技能等级标准</a></li>
                <li ><a href="/certificate/dataDownload/teaching">课证融通标准</a></li>
                <li ><a href="/certificate/dataDownload/scoreCriteria">考核评分标准</a></li>
                <li class="this"><a href="/certificate/dataDownload/evaluationCriteria">考评配套资源</a></li>
                <li ><a href="/certificate/dataDownload/courseCriteria">课程标准</a></li>
                <li ><a href="/certificate/dataDownload/operationManual">操作手册</a></li>
                <li ><a href="/certificate/dataDownload/otherData">其他资料</a></li>
            </ul>
        </div>
        <div class="div_2">
            <div id="news"></div>
            <div id="page"></div>
        </div>
        <div style="clear: both"></div>
    </section>

</main>
<div th:include="certificateWeb/headFoot :: footer"></div>

<script>
    $(function () {
        var username=window.localStorage.getItem("userName");
        if(username==''||username==null)
            location.href='/certificate/loginWeb';
        $.ajax({
            url: "/jzApi/index/selNewsList",
            type: 'GET',
            data: {
                firstColumn:'证书考试门户',
                columnName: '考评配套资源',
                current: 1,
                number:14
            },
            beforeSend: function (request) {
                request.setRequestHeader("Authorization", window.localStorage.getItem("token"))
            },
            success: function (res) {
                if (res.code === 10000 || res.code === '10000') {
                // 登录态失效, 重新登录
                location.href = "/certificate/loginWeb"
                }
                else if(res.data.pages==0){
                    $("#news").html('<div class="noData">暂无数据</div>');
                }else{
                    var list = res.data.records;
                    console.log("232",list)
                    var news = '';
                    list.forEach(function (item, index) {
                        news += '<a download href="' + item.files + '" target="_blank" class="flex"><span class="span_2">' + item.title + '</span>' +
                            '<span class="span_1">' + item.createrDate + '</span></a>';
                    });
                    $("#news").html(news);
                    page(1,res.data.pages);
                }
            },
            error: function (res) {
            if (res.status == 401) {
                // 登录态失效, 重新登录
                location.href = "/certificate/loginWeb"
            } else {
                fail && fail(res);
                layer.confirm(res.errMsg);
            }
        }
        });
    });
    function page(num,tolPages) {
        $("#page").paging({
            nowPage:Number(num), // 当前页码
            pageNum:Number(tolPages), // 总页码
            buttonNum:10, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 1,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                $.ajax({
                    url: "/jzApi/index/selNewsList",
                    type: 'GET',
                    data: {
                        firstColumn:'证书考试门户',
                        columnName: '考评配套资源',
                        current: num,
                        number: 14
                    },
                    success:function (res) {
                        // console.log(res);
                        var list = res.data.records;
                        var news = '';
                        list.forEach(function (item, index) {
                            news += '<a download href="' + item.files + '" target="_blank" class="flex"><span class="span_2">' + item.title + '</span>' +
                                '<span class="span_1">' + item.createrDate + '</span></a>';
                        });
                        $("#news").html(news)
                    }
                });
            }
        });
    }
</script>
<script type="text/javascript" src="/js/xlPaging.js"></script>

</body>
</html>